#pragma once
#include <d3d9.h>
#include <d3dx9.h>
#include <map>
#include <vector>
#include <string>
#include "defs.h"
#include "Gets.h"
using namespace std;


class cDXFont
{
public:
	cDXFont();
	void SetFontDesc(INT Height,UINT Width,UINT Weight,BOOL Italic,TCHAR* Facename);
	void Create();
	void DrawText(LPCWSTR pString,LPRECT pRect,DWORD Format,D3DCOLOR Color);
	HRESULT OnLostDevice(){ return m_pFont->OnLostDevice(); }
	HRESULT OnResetDevice(){ return m_pFont->OnResetDevice(); }
	void Release();
private:
	LPDIRECT3DDEVICE9 pDevice;

	D3DXFONT_DESC m_FontDesc;
	ID3DXFont* m_pFont;
};

class cFontMgr
{
public:
	void PushFont(string name,cDXFont* font);
	cDXFont* GetFont(string name);
	void Release();
private:
	map<string,cDXFont*> mapFont;	
};